package com.app.megaprosoft.modyimcarcare;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Calendar;

import com.megaprosoft.modyimcarcare.R;



import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;

public class ChkSafStdMainActivity extends Activity {
	
	connect con = new connect();
	ResultSet rs,rs2;
	TextView TT,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10; 
	RadioButton Normal,a1,a2,b1,b2,c1,c2,d1,d2,e1,e2,f1,f2,g1,g2,h1,h2,i1,i2,j1,j2;
	
	String list1="����ѹ�ä�ѷ��",list2="����ѹ����������/�ѵ��ѵ�",list3="����ѹ��ͧ����",list4="����ѹ�ǧ������������",list5="����ѹ�礡�Ш�/��ҹ�Ѵ"
			,list6="�������͹��/��/����ҧ/����Ѵ�Ѵ����ҧ",list7="����ͧ�ҡ��",list8="ẵ�����-��ӡ���/����",list9="��¾ҹ����ͧ¹��/����",list10="��Ҿ�ҧ���ҧ";
	
	String StatuS,utd1,utd2,utd3,utd4,utd5,utd6,utd7,utd8,utd9,utd10;
	
	String Normal1="",Normal2="",Normal3="",Normal4="",Normal5="",Normal6="",Normal7="",Normal8="",
			Normal9="",Normal10="";
	
	float fix= 0;
	
	int timeCheck;
	
	// Spinner spn1,spn2,spn3,spn4,spn5,spn6,spn7,spn8,spn9,spn10;

	String id,RegisID,Type,NameUser;
	
	 
	 ArrayList<String> strSpn = new ArrayList<String>();
	 ArrayList<String> strSpn1 = new ArrayList<String>();
	 ArrayList<String> strSpn2 = new ArrayList<String>();
	 ArrayList<String> strSpn3 = new ArrayList<String>();
	 ArrayList<String> strSpn4 = new ArrayList<String>();
	 ArrayList<String> strSpn5 = new ArrayList<String>();
	 ArrayList<String> strSpn6 = new ArrayList<String>();
	 ArrayList<String> strSpn7 = new ArrayList<String>();
	 ArrayList<String> strSpn8 = new ArrayList<String>();
	 ArrayList<String> strSpn9 = new ArrayList<String>();
	 
	
	String ServiceID;
    private int mYear;
    private int mMonth;
    private int mDay;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_chk_saf_std_main);

		id = getIntent().getExtras().getString("IntentID");		
		RegisID = getIntent().getExtras().getString("RegisID");	
		Type = getIntent().getExtras().getString("Type");
		NameUser = getIntent().getExtras().getString("nameCheck");
		
		final Calendar c = Calendar.getInstance();
		
        mYear = c.get(Calendar.YEAR);
        mMonth = c.get(Calendar.MONTH);
        mDay = c.get(Calendar.DAY_OF_MONTH); 
        
          T1 = (TextView) findViewById(R.id.t1);
          a1 = (RadioButton) findViewById(R.id.a1);
          a2 = (RadioButton) findViewById(R.id.a2);
        
          T2 = (TextView) findViewById(R.id.t2);
          b1 = (RadioButton) findViewById(R.id.b1);
          b2 = (RadioButton) findViewById(R.id.b2);
          
          T3 = (TextView) findViewById(R.id.t3);
          c1 = (RadioButton) findViewById(R.id.c1);
          c2 = (RadioButton) findViewById(R.id.c2);
          
          T4 = (TextView) findViewById(R.id.t4);
          d1 = (RadioButton) findViewById(R.id.d1);
          d2 = (RadioButton) findViewById(R.id.d2);
          
          
          T5 = (TextView) findViewById(R.id.t5);
          e1 = (RadioButton) findViewById(R.id.e1);
          e2 = (RadioButton) findViewById(R.id.e2);
          
          T6 = (TextView) findViewById(R.id.t6);
          f1 = (RadioButton) findViewById(R.id.f1);
          f2 = (RadioButton) findViewById(R.id.f2);
          
          T7 = (TextView) findViewById(R.id.t7);
          g1 = (RadioButton) findViewById(R.id.g1);
          g2 = (RadioButton) findViewById(R.id.g2);
          
          T8 = (TextView) findViewById(R.id.t8);
          h1 = (RadioButton) findViewById(R.id.h1);
          h2 = (RadioButton) findViewById(R.id.h2);
          
          
          
          T9 = (TextView) findViewById(R.id.t9);
          i1 = (RadioButton) findViewById(R.id.i1);
          i2 = (RadioButton) findViewById(R.id.i2);
          
          T10 = (TextView) findViewById(R.id.t10);
          j1 = (RadioButton) findViewById(R.id.j1);
          j2 = (RadioButton) findViewById(R.id.j2);
        
		/////////////// select ////////////////////
		
		  SpnC1();
		  SpnC2();
		  SpnC3();
		  SpnC4();
		  SpnC5();
		  SpnC6();
		  SpnC7();
		  SpnC8();
		  SpnC9();
		  SpnC10();
		  
		  
		  
		  
	
		Button btn1 = (Button) findViewById(R.id.button1);
		Button btn2 = (Button) findViewById(R.id.button2);
		
	
///////////////////////////////////////////////////1		
		a1.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				a1.isChecked();
					Normal1 ="����";
			}
		});
			
///////////////////////////////////////////////////////2		
		a2.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				a2.isChecked();
					Normal1 ="��軡��";
			}
		});
///////////////////////////////////////////////////////3
		b1.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				b1.isChecked();
					Normal2 ="����";
			}
		});
///////////////////////////////////////////////////////4
		b2.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				b2.isChecked();
				Normal2 ="��軡��";
			}
		});
///////////////////////////////////////////////////////5
		c1.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				c1.isChecked();
					Normal3 ="����";
			}
		});
///////////////////////////////////////////////////////6
		c2.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				c2.isChecked();
					Normal3 ="��軡��";
			}
		});
///////////////////////////////////////////////////////7
		d1.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				d1.isChecked();
					Normal4 ="����";
			}
		});
///////////////////////////////////////////////////////8
		d2.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				d2.isChecked();
					Normal4 ="��軡��";
			}
		});
///////////////////////////////////////////////////////9
		e1.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				e1.isChecked();
					Normal5 ="����";
			}
		});
///////////////////////////////////////////////////////10
		e2.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				e2.isChecked();
					Normal5 ="��軡��";
			}
		});
///////////////////////////////////////////////////////11
		f1.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				f1.isChecked();
					Normal6 ="����";
			}
		});
///////////////////////////////////////////////////////12
		f2.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				f2.isChecked();
					Normal6="��軡��";;
			}
		});
///////////////////////////////////////////////////////13
		g1.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				g1.isChecked();
					Normal7 ="����";
			}
		});
///////////////////////////////////////////////////////14
		g2.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				g2.isChecked();
					Normal7 ="��軡��";
			}
		});
///////////////////////////////////////////////////////15
		h1.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				h1.isChecked();
					Normal8 ="����";
			}
		});
///////////////////////////////////////////////////////16
		h2.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				h2.isChecked();
					Normal8 ="��軡��";
			}
		});
///////////////////////////////////////////////////////17
		i1.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				i1.isChecked();
					Normal9 ="����";
			}
		});
///////////////////////////////////////////////////////18
		i2.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				i2.isChecked();
					Normal9 ="��軡��";
			}
		});
///////////////////////////////////////////////////////19
		j1.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				j1.isChecked();
					Normal10 ="����";
			}
		});
///////////////////////////////////////////////////////20
		j2.setOnClickListener(new View.OnClickListener() {
			 
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				j2.isChecked();
					Normal10 ="��軡��";
			}
		});
//////////////////////////**  **/////////////////////////////2
		
		
	
		btn1.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
			 /*
				rs = con.selectData("SELECT MAX(ServiceID) AS maxid FROM CustomerCar WHERE RegisterID = '"+InitialServices.RegisterIDS+"' ");
				try {
					rs.next();
					ServiceID = rs.getString("maxid");
				*/
				 			
				String sql = "INSERT INTO DataService " + 
						"(ServiceID,TypeID,List,price,Promotion,Discount,amount,Sum,sumTime,date,Normal,Note) " +
						"VALUES ("+
						"'"+ServiceID+"'" + ',' + 
						"'"+Type+"'" + ',' + 
						"'"+list1+","+list2+","+list3+","+list4+","+list5+","+list6+","
						   +list7+","+list8+","+list9+","+list10+"'" + ',' + 
						"'"+"0"+"'" + ',' + 
						"'"+"0"+"'" + ',' +
						"'"+0+"'" + ',' +
						"'"+0+"'" + ',' +
						"'"+0+"'" + ',' +
						"'"+timeCheck+"'" + ',' +
				        "'"+mDay+"/"+(1+mMonth)+"/"+mYear+"'" +
				        "'"+Normal1+","+Normal2+","+Normal3+","+Normal4+","+Normal5+","+Normal6+","+Normal7+
				           ","+Normal8+","+Normal9+","+Normal10+"'" + ',' +
				        "'"+utd1+","+utd2+","+utd3+","+utd4+","+utd5+","+utd6+","+utd7+","+utd8+","+utd9+","+utd10+"'" +")"; 
				
				
			if(con.addData(sql)){	 
			Toast.makeText(ChkSafStdMainActivity.this, "Inserted data successfully", Toast.LENGTH_SHORT).show();
			//Open Form Add
			Toast.makeText(ChkSafStdMainActivity.this, ServiceID, Toast.LENGTH_SHORT).show();
			Intent newActivity = new Intent(ChkSafStdMainActivity.this,MainActivity.class);
			
			
			
			startActivity(newActivity);
			
			}else{
		    Toast.makeText(ChkSafStdMainActivity.this, "Inserted data fail\n"+ServiceID+"\n"+Type+
		    		"\n"+list1+"\n"+list2+"\n"+list3+"\n"
			+list4+"\n"+list5+"\n"+list6+"\n"+list7+"\n"+list8+"\n"+list9+"\n"+list10+"\n"
		    		+"\n\n"+Normal1+Normal2+Normal3+Normal4+Normal5+Normal6+
				        Normal7+Normal8+Normal9+Normal10+"\n\n"+utd1+utd2+utd3+utd4
				        +"\n"+timeCheck 
				        +"\n"
		    		+utd5+utd6+utd7+utd8+utd9+utd10+"\n\n"+mDay+"/"+(1+mMonth)+"/"+mYear, Toast.LENGTH_SHORT).show();
		    
		    
			}

			/*
			 * } catch (SQLException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
			*/
			}
			});
		
		btn2.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
			 
				//Open Form Add
				finish();

			}
			
			

			});
	}

	////////////////////////////////////////////////////////////////////////////  �����˵� 1
private void SpnC1() {
	
		final Spinner spn1 = (Spinner) findViewById(R.id.spinC1);
		
		strSpn.add("#�����˵�#");
		strSpn.add("����¹");
		strSpn.add("�������¹");
		
		
		ArrayAdapter<String> empolyeeAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,strSpn)
;
		empolyeeAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
		spn1.setAdapter(empolyeeAdapter);
		
		spn1.setOnItemSelectedListener(new  AdapterView.OnItemSelectedListener() { 

			public void onItemSelected(AdapterView<?> adapterView, 
				View view, int i, long l) { 
				// TODO Auto-generated method stub
				
				
				utd1 = strSpn.get(i);
				
				}
			public void onNothingSelected(AdapterView<?> arg0) {
				// TODO Auto-generated method stub
				Toast.makeText(ChkSafStdMainActivity.this,
							String.valueOf("ʶҹ��ա������¹�ŧ����"),
								Toast.LENGTH_SHORT).show();
			 
		}	
			
		});
}
////////////////////////////////////////////////////////////////////////////  �����˵� 2
private void SpnC2() {

	final Spinner spn2 = (Spinner) findViewById(R.id.spinC2);
	
	strSpn1.add("#�����˵�#");
	strSpn1.add("����¹");
	strSpn1.add("�������¹");
	
	
	ArrayAdapter<String> empolyeeAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,strSpn1)
;
	empolyeeAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
	spn2.setAdapter(empolyeeAdapter);
	
	spn2.setOnItemSelectedListener(new  AdapterView.OnItemSelectedListener() { 

		public void onItemSelected(AdapterView<?> adapterView, 
			View view, int i, long l) { 
			// TODO Auto-generated method stub
			
			
			utd2 = strSpn1.get(i);
			
			}
		public void onNothingSelected(AdapterView<?> arg0) {
			// TODO Auto-generated method stub
			Toast.makeText(ChkSafStdMainActivity.this,
						String.valueOf("ʶҹ��ա������¹�ŧ����"),
							Toast.LENGTH_SHORT).show();
		 
	}	
		
	});
}
////////////////////////////////////////////////////////////////////////////  �����˵� 3

private void SpnC3() {

	final Spinner spn3 = (Spinner) findViewById(R.id.spinC3);
	
	strSpn2.add("#�����˵�#");
	strSpn2.add("����¹");
	strSpn2.add("�������¹");
	
	
	ArrayAdapter<String> empolyeeAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,strSpn2)
;
	empolyeeAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
	spn3.setAdapter(empolyeeAdapter);
	
	spn3.setOnItemSelectedListener(new  AdapterView.OnItemSelectedListener() { 

		public void onItemSelected(AdapterView<?> adapterView, 
			View view, int i, long l) { 
			// TODO Auto-generated method stub
			
			
			utd3 = strSpn2.get(i);
			
			}
		public void onNothingSelected(AdapterView<?> arg0) {
			// TODO Auto-generated method stub
			Toast.makeText(ChkSafStdMainActivity.this,
						String.valueOf("ʶҹ��ա������¹�ŧ����"),
							Toast.LENGTH_SHORT).show();
		 
	}	
		
	});
}

/////////////////////////////////////////////////////////////////////////////////  �����˵� 4

private void SpnC4() {

	final Spinner spn4 = (Spinner) findViewById(R.id.spinC4);
	
	strSpn3.add("#�����˵�#");
	strSpn3.add("����¹");
	strSpn3.add("�������¹");
	
	
	ArrayAdapter<String> empolyeeAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,strSpn3)
;
	empolyeeAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
	spn4.setAdapter(empolyeeAdapter);
	
	spn4.setOnItemSelectedListener(new  AdapterView.OnItemSelectedListener() { 

		public void onItemSelected(AdapterView<?> adapterView, 
			View view, int i, long l) { 
			// TODO Auto-generated method stub
			
			
			utd4 = strSpn3.get(i);
			
			}
		public void onNothingSelected(AdapterView<?> arg0) {
			// TODO Auto-generated method stub
			Toast.makeText(ChkSafStdMainActivity.this,
						String.valueOf("ʶҹ��ա������¹�ŧ����"),
							Toast.LENGTH_SHORT).show();
		 
	}	
		
	});
}

/////////////////////////////////////////////////////////////////////////////////  �����˵� 5
private void SpnC5() {

	final Spinner spn5 = (Spinner) findViewById(R.id.spinC5);
	
	strSpn4.add("#�����˵�#");
	strSpn4.add("����¹");
	strSpn4.add("�������¹");
	
	
	ArrayAdapter<String> empolyeeAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,strSpn4)
;
	empolyeeAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
	spn5.setAdapter(empolyeeAdapter);
	
	spn5.setOnItemSelectedListener(new  AdapterView.OnItemSelectedListener() { 

		public void onItemSelected(AdapterView<?> adapterView, 
			View view, int i, long l) { 
			// TODO Auto-generated method stub
			
			
			utd5 = strSpn4.get(i);
			
			}
		public void onNothingSelected(AdapterView<?> arg0) {
			// TODO Auto-generated method stub
			Toast.makeText(ChkSafStdMainActivity.this,
						String.valueOf("ʶҹ��ա������¹�ŧ����"),
							Toast.LENGTH_SHORT).show();
		 
	}	
		
	});
}

/////////////////////////////////////////////////////////////////////////////////  �����˵� 6
private void SpnC6() {

	final Spinner spn6 = (Spinner) findViewById(R.id.spinC6);
	
	strSpn5.add("#�����˵�#");
	strSpn5.add("����¹");
	strSpn5.add("�������¹");
	
	
	ArrayAdapter<String> empolyeeAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,strSpn5)
;
	empolyeeAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
	spn6.setAdapter(empolyeeAdapter);
	
	spn6.setOnItemSelectedListener(new  AdapterView.OnItemSelectedListener() { 

		public void onItemSelected(AdapterView<?> adapterView, 
			View view, int i, long l) { 
			// TODO Auto-generated method stub
			
			
			utd6 = strSpn5.get(i);
			
			}
		public void onNothingSelected(AdapterView<?> arg0) {
			// TODO Auto-generated method stub
			Toast.makeText(ChkSafStdMainActivity.this,
						String.valueOf("ʶҹ��ա������¹�ŧ����"),
							Toast.LENGTH_SHORT).show();
		 
	}	
		
	});
}

/////////////////////////////////////////////////////////////////////////////////  �����˵� 7
private void SpnC7() {

	final Spinner spn7 = (Spinner) findViewById(R.id.spinC7);
	
	strSpn6.add("#�����˵�#");
	strSpn6.add("����¹");
	strSpn6.add("�������¹");
	
	
	ArrayAdapter<String> empolyeeAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,strSpn6)
;
	empolyeeAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
	spn7.setAdapter(empolyeeAdapter);
	
	spn7.setOnItemSelectedListener(new  AdapterView.OnItemSelectedListener() { 

		public void onItemSelected(AdapterView<?> adapterView, 
			View view, int i, long l) { 
			// TODO Auto-generated method stub
			
			
			utd7 = strSpn6.get(i);
			
			}
		public void onNothingSelected(AdapterView<?> arg0) {
			// TODO Auto-generated method stub
			Toast.makeText(ChkSafStdMainActivity.this,
						String.valueOf("ʶҹ��ա������¹�ŧ����"),
							Toast.LENGTH_SHORT).show();
		 
	}	
		
	});
}

/////////////////////////////////////////////////////////////////////////////////  �����˵� 8
private void SpnC8() {

	final Spinner spn8 = (Spinner) findViewById(R.id.spinC8);
	
	strSpn7.add("#�����˵�#");
	strSpn7.add("����¹");
	strSpn7.add("�������¹");
	
	
	ArrayAdapter<String> empolyeeAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,strSpn7)
;
	empolyeeAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
	spn8.setAdapter(empolyeeAdapter);
	
	spn8.setOnItemSelectedListener(new  AdapterView.OnItemSelectedListener() { 

		public void onItemSelected(AdapterView<?> adapterView, 
			View view, int i, long l) { 
			// TODO Auto-generated method stub
			
			
			utd8 = strSpn7.get(i);
			
			}
		public void onNothingSelected(AdapterView<?> arg0) {
			// TODO Auto-generated method stub
			Toast.makeText(ChkSafStdMainActivity.this,
						String.valueOf("ʶҹ��ա������¹�ŧ����"),
							Toast.LENGTH_SHORT).show();
		 
	}	
		
	});
}

/////////////////////////////////////////////////////////////////////////////////  �����˵� 9
private void SpnC9() {

	final Spinner spn9 = (Spinner) findViewById(R.id.spinC9);
	
	strSpn8.add("#�����˵�#");
	strSpn8.add("����¹");
	strSpn8.add("�������¹");
	
	
	ArrayAdapter<String> empolyeeAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,strSpn8)
;
	empolyeeAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
	spn9.setAdapter(empolyeeAdapter);
	
	spn9.setOnItemSelectedListener(new  AdapterView.OnItemSelectedListener() { 

		public void onItemSelected(AdapterView<?> adapterView, 
			View view, int i, long l) { 
			// TODO Auto-generated method stub
			
			
			utd9 = strSpn8.get(i);
			
			}
		public void onNothingSelected(AdapterView<?> arg0) {
			// TODO Auto-generated method stub
			Toast.makeText(ChkSafStdMainActivity.this,
						String.valueOf("ʶҹ��ա������¹�ŧ����"),
							Toast.LENGTH_SHORT).show();
		 
	}	
		
	});
}

///////////////////////////////////////////////////10
private void SpnC10() {

	final Spinner spn10 = (Spinner) findViewById(R.id.spinC10);
	
	strSpn9.add("#�����˵�#");
	strSpn9.add("����¹");
	strSpn9.add("�������¹");
	
	
	ArrayAdapter<String> empolyeeAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,strSpn9)
;
	empolyeeAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
	spn10.setAdapter(empolyeeAdapter);
	
	spn10.setOnItemSelectedListener(new  AdapterView.OnItemSelectedListener() { 

		public void onItemSelected(AdapterView<?> adapterView, 
			View view, int i, long l) { 
			// TODO Auto-generated method stub
			
			
			utd10 = strSpn9.get(i);
			
			}
		public void onNothingSelected(AdapterView<?> arg0) {
			// TODO Auto-generated method stub
			Toast.makeText(ChkSafStdMainActivity.this,
						String.valueOf("ʶҹ��ա������¹�ŧ����"),
							Toast.LENGTH_SHORT).show();
		 
	}	
		
	});
}
		

@Override
public void onBackPressed() {
  
        

}

@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
